exports.noOp = function(req, res){};

exports.abstractMethod = function() {
  throw new Error("abstract method");
};

exports.repeat = function(list, func, done, index) {
  index = index || 0;
  if(index < list.length) {
    func(list[index], function(err, object) {
      exports.repeat(list, func, done, index + 1);
    });
  } else {
    done();
  }
};

exports.repeatObject = function(object, func, done, index) {
  var keys = Object.keys(object);
  index = index || 0;
  if(index < keys.length) {
    func(keys[index], object[keys[index]], function(err, result){
      exports.repeatObject(object, func, done, index + 1);
    });
  } else {
    done();
  }
};